//
//  CourseCommentUserTableViewCell.m
//  TeacherNet
//
//  Created by slz on 2017/11/22.
//  Copyright © 2017年 bnsr. All rights reserved.
//

#import "CourseCommentUserTableViewCell.h"
#import "CourseCommentPageModel.h"
@implementation CourseCommentUserTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.avatar.layer.masksToBounds = YES;
    self.avatar.layer.cornerRadius = 25;
    
    _ratingView = [EDStarRating new];
    _ratingView.backgroundColor = [UIColor whiteColor];
    _ratingView.starImage = [UIImage imageNamed:@"course_star_comment"];
    _ratingView.starHighlightedImage = [UIImage imageNamed:@"course_star_comment_highlighted"];
    _ratingView.maxRating=5.0;
    _ratingView.horizontalMargin = 10;
    _ratingView.editable=NO;
    _ratingView.displayMode=EDStarRatingDisplayFull;
    _ratingView.rating = 3;
    [self.contentView addSubview:_ratingView];
    [_ratingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.contentView.mas_right).offset(-17);
        make.centerY.mas_equalTo(self.UserNameLabel.mas_centerY);
        make.width.mas_equalTo(150);
        make.height.mas_equalTo(20);
    }];
    
    UIView * lineView = [UIView quickLineColorView];
    [self.contentView addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.and.bottom.mas_equalTo(self.contentView);
        make.height.mas_equalTo(.5);
    }];
    // Initialization code
}

- (void)setWithCommentModel:(CourseUserCommentModel *)model
{
    _ratingView.rating = 3;
    [_ratingView setNeedsDisplay];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
